﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Riel_Gestion.dao;
using Riel_Gestion.entities;
using log4net;

namespace Riel_Gestion
{
    public partial class FrmCuadroBalanceCliente : Form
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(FrmCompra));

        DateTime fDesde;

        public DateTime FDesde
        {
            get { return fDesde; }
            set { fDesde = value; }
        }
        DateTime fHasta;

        public DateTime FHasta
        {
            get { return fHasta; }
            set { fHasta = value; }
        }

        public FrmCuadroBalanceCliente()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmCuadroBalanceCliente_Load(object sender, EventArgs e)
        {
            logger.Info("Cargando Saldos...");

            DTOSaldo saldos = new DTOSaldo();

            saldos = VentaDAO.getSaldosTotalesByDates(fDesde, fHasta);

            lblDebe.Text = saldos.TotDebe.ToString();
            lblHaber.Text = saldos.TotHaber.ToString();
            lblSaldo.Text = saldos.TotSaldo.ToString();

            logger.Info("lblDebe: " + lblDebe.Text);
            logger.Info("lblHaber: " + lblHaber.Text);
            logger.Info("lblSaldo: " + lblSaldo.Text);
        }
    }
}
